#include <cstdio>
#include <cmath>
#define eps 1e-8
struct point{double x,y;};

double distance(point p1,point p2){
    return sqrt((p1.x-p2.x)*(p1.x-p2.x)+(p1.y-p2.y)*(p1.y-p2.y));
}

point intersection(point u1,point u2,point v1,point v2){
    point ret=u1;
    double t=((u1.x-v1.x)*(v1.y-v2.y)-(u1.y-v1.y)*(v1.x-v2.x))
            /((u1.x-u2.x)*(v1.y-v2.y)-(u1.y-u2.y)*(v1.x-v2.x));
    ret.x+=(u2.x-u1.x)*t;
    ret.y+=(u2.y-u1.y)*t;
    return ret;
}

void intersection_line_circle(point c,double r,point l1,point l2,point& p1,point& p2){
    point p=c;
    double t;
    p.x+=l1.y-l2.y;
    p.y+=l2.x-l1.x;
    p=intersection(p,c,l1,l2);
    t=sqrt(r*r-distance(p,c)*distance(p,c))/distance(l1,l2);
    p1.x=p.x+(l2.x-l1.x)*t;
    p1.y=p.y+(l2.y-l1.y)*t;
    p2.x=p.x-(l2.x-l1.x)*t;
    p2.y=p.y-(l2.y-l1.y)*t;
}

void intersection_circle_circle(point c1,double r1,point c2,double r2,point& p1,point& p2){
    point u,v;
    double t;
    t=(1+(r1*r1-r2*r2)/distance(c1,c2)/distance(c1,c2))/2;
    u.x=c1.x+(c2.x-c1.x)*t;
    u.y=c1.y+(c2.y-c1.y)*t;
    v.x=u.x+c1.y-c2.y;
    v.y=u.y-c1.x+c2.x;
    intersection_line_circle(c1,r1,u,v,p1,p2);
}

int intersect_circle_circle(point c1,double r1,point c2,double r2){
    return distance(c1,c2)<r1+r2+eps&&distance(c1,c2)>fabs(r1-r2)-eps;
}

int main( )
{
    int n, i, j, k, ans, t;
    point p[ 101 ], p1, p2;
    double r[ 101 ];
    while ( scanf("%d", &n) != EOF )
    {
        for ( i = 0; i < n; i++ )
            scanf("%lf%lf%lf", &p[ i ].x, &p[ i ].y, &r[ i ]);
        ans = 0;
        for ( i = 0; i < n; i++ )
        {
            for ( j = i + 1; j < n; j++ )
                if ( intersect_circle_circle( p[ i ], r[ i ], p[ j ], r[ j ] ) )
                {
                    intersection_circle_circle( p[ i ], r[ i ], p[ j ], r[ j ], p1, p2 );
                    t = 0;
                    for ( k = 0; k < n; k++ )
                        if ( distance( p1, p[ k ] ) <= r[ k ] + eps )
                            t++;
                    if ( ans < t ) ans = t;
                    t = 0;
                    for ( k = 0; k < n; k++ )
                        if ( distance( p2, p[ k ] ) <= r[ k ] + eps )
                            t++;
                    if ( ans < t ) ans = t;
                }
                t = 0;
                for ( k = 0; k < n; k++ )
                    if ( distance( p[ i ], p[ k ] ) <= r[ k ] + eps )
                        t++;
                if ( ans < t ) ans = t;
        }
        printf("%d\n", ans);
    }
    return 0;
}
